package com.bocai.kelala.widget;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.bocai.kelala.bean.CarInfoBean;
import com.bumptech.glide.Glide;

/**
 * Created by yuanfei on 2017/6/12.
 */

public class LocalImageHolderView implements Holder<CarInfoBean.CarImagesBean> {
    private ImageView imageView;

    private Context context;
    public LocalImageHolderView(Context context){
        this.context=context;

    }
    @Override
    public View createView(Context context) {
        imageView = new ImageView(context);
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        return imageView;
    }


    @Override
    public void UpdateUI(Context context, int position, CarInfoBean.CarImagesBean data) {
        Glide.with(context).load(data.getMediumThumbnail()).into(imageView);
    }
}
